﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AMS
{
    public partial class frmError : Form
    {
        public frmError(Exception ex)
        {
            InitializeComponent();
            DisplayException(ex);
            this.ShowDialog();
        }

        public frmError()
        {
            InitializeComponent();
        }

        public void LoadException(Exception ex)
        {
            DisplayException(ex);
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void DisplayException(Exception ex)
        {
            rtbSource.Text = ex.Source;
            rtbMessage.Text = ex.Message;
            rtbStack.Text = ex.StackTrace;
        }
    }
}
